<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>开始考试</title>
    <link rel="stylesheet" th:href="@{/static/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/static/css/exam/examing.css}">
</head>
<body>

    <div>
        <ul class="layui-nav">
            <li class="layui-nav-item" th:text="'姓名：' + ${session.tUser.UName}"></li>
            <li class="layui-nav-item" th:text="'试卷名：' + ${pname}"></li>
            <li class="layui-nav-item">剩余时间：</li>
            <li class="layui-nav-item timespan"><input type="hidden" th:class="endtime" th:value="${endtime}">00 : 00 : 00</li>
        </ul>
    </div>

    <input type="hidden" name="uId" class="uId" th:value="${session.tUser.UId}">
    <input type="hidden" name="pId" class="pId" th:value="${pid}">

    <form class="layui-form">

        <div class="layui-form-item" th:each="question,step: ${questions}" th:switch="${question.QType}">
            <div th:case="'1'">
                <div class="layui-field-title" th:text="${step.count} + '：' + ${question.QTitle} + '（单选题：' + ${question.QScore} + '分）'"></div>
                <div class="layui-input">
                    <input type="radio" th:name="'single_' + ${question.QId}" lay-verify="otherReq" value="A" th:title="'A、' + ${question.QAnswer1}">
                </div>
                <div class="layui-input">
                    <input type="radio" th:name="'single_' + ${question.QId}" lay-verify="otherReq" value="B" th:title="'B、' + ${question.QAnswer2}">
                </div>
                <div class="layui-input">
                    <input type="radio" th:name="'single_' + ${question.QId}" lay-verify="otherReq" value="C" th:title="'C、' + ${question.QAnswer3}">
                </div>
                <div class="layui-input">
                    <input type="radio" th:name="'single_' + ${question.QId}" lay-verify="otherReq" value="D" th:title="'D、' + ${question.QAnswer4}">
                </div>
            </div>
            <div th:case="'2'">
                <div class="layui-field-title" th:text="${step.count} + '：' + ${question.QTitle} + '（多选题：' + ${question.QScore} + '分）'"></div>
                <div class="layui-input">
                    <input type="checkbox" th:name="'multiple_' + ${question.QId}" lay-verify="otherReq" lay-skin="primary" value="A" th:title="'A、' + ${question.QAnswer1}">
                </div>
                <div class="layui-input">
                    <input type="checkbox" th:name="'multiple_' + ${question.QId}" lay-verify="otherReq" lay-skin="primary" value="B" th:title="'B、' + ${question.QAnswer2}">
                </div>
                <div class="layui-input">
                    <input type="checkbox" th:name="'multiple_' + ${question.QId}" lay-verify="otherReq" lay-skin="primary" value="C" th:title="'C、' + ${question.QAnswer3}">
                </div>
                <div class="layui-input">
                    <input type="checkbox" th:name="'multiple_' + ${question.QId}" lay-verify="otherReq" lay-skin="primary" value="D" th:title="'D、' + ${question.QAnswer4}">
                </div>
            </div>
            <div th:case="'3'">
                <div class="layui-field-title" th:text="${step.count} + '：' + ${question.QTitle} + '（简答题：' + ${question.QScore} + '分）'"></div>
                <textarea th:name="'short_' + ${question.QId}" class="layui-textarea" style="resize: none"></textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo" id="butt">提交试卷</button>
            </div>
        </div>

    </form>

    <script type="text/javascript" th:src="@{/static/layui.js}"></script>
    <script type="text/javascript" th:src="@{/static/js/jquery-3.2.1.min.js}"></script>
    <script type="text/javascript" th:src="@{/static/js/exam/examing.js}"></script>
</body>
</html>